{extend name="admin@index_layout"/}
{block name="main"}
<style>
input[type=number] {  
    -moz-appearance:textfield;  
}  
input[type=number]::-webkit-inner-spin-button,  
input[type=number]::-webkit-outer-spin-button {  
    -webkit-appearance: none;  
    margin: 0;  
}
</style>
<form class="layui-form" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">导出数量</label>
        <div class="layui-input-block">
            <input type="number" name="number" lay-verify="required" autocomplete="off" placeholder="数量" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" id="submit" type="button">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>
{/block}
{block name="script"}
<script type="text/javascript">
$('#submit').click(function(){
    var number = $('input[name=number]').val()
    $.post("/qrcode/qrcode/export", {number: number}, function (res) {
        console.log(res)
        location.href = res.url
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
        parent.$('[data-table-refresh]').trigger("click");
    })
})
</script>
{/block}